home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / mosmllib / Timer.sig < prev    next >
Encoding:
Text File  |  1997-08-18  |  1.3 KB  |  44 lines  |  [TEXT/R*ch]

  1. (* Timer -- SML Basis Library *)
  2.  
  3. local 
  4.     type time = Time.time
  5. in
  6.     type cpu_timer
  7.     type real_timer
  8.  
  9.     val startCPUTimer : unit -> cpu_timer
  10.     val totalCPUTimer : unit -> cpu_timer
  11.     val checkCPUTimer : cpu_timer -> {usr : time, sys : time, gc : time}
  12.  
  13.     val startRealTimer : unit -> real_timer
  14.     val totalRealTimer : unit -> real_timer
  15.     val checkRealTimer : real_timer -> time
  16. end
  17.  
  18. (* A [cpu_timer] measures the CPU time consumed.
  19.  
  20.    A [real_timer] measures the real time that has passed.
  21.  
  22.    [startCPUTimer ()] returns a cpu_timer started at the moment of 
  23.    the call.
  24.  
  25.    [totalCPUTimer ()] returns a cpu_timer started at the moment the 
  26.    library was loaded.
  27.  
  28.    [checkCPUTimer tmr] returns {usr, sys, gc} where usr is the amount
  29.    of user CPU time consumed since tmr was started, gc is the amount
  30.    of user CPU time spent on garbage collection, and sys is the
  31.    amount of system CPU time consumed since tmr was started.  Note
  32.    that gc time is included in the usr time.  Under MS DOS, usr time
  33.    and gc time are measured in real time.
  34.  
  35.    [startRealTimer ()] returns a real_timer started at the moment of 
  36.    the call.
  37.  
  38.    [totalRealTimer ()] returns a real_timer started at the moment the 
  39.    library was loaded.
  40.  
  41.    [checkRealTimer tmr] returns the amount of real time that has passed
  42.    since tmr was started.
  43. *)
  44.